import request from "@/utils/request";
import type {
  LoginApiResponse,
  GetUserInfoApiResponse,
} from "./model/loginModel";
enum Api {
  getLogin = "/admin/acl/index/login",
  logout = "/admin/acl/index/logout",
  getUserInfo = "/admin/acl/index/info",
}

// 登入
export const getLoginApi = ( username:string, password:string) => {
  return request.post<any, LoginApiResponse>(Api.getLogin, {
    username,
    password,
  });


};

// 退出
// 登出
// 登出
export const logoutApi = () => {
  return request.post<any, null>(Api.logout);
};

// 获取用户信息

export const getUserInfoApi =()=>{
   return request.get<any, GetUserInfoApiResponse>(Api.getUserInfo);
}